<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>初始Vue</title>
    <!--引入Vue-->
    <script type="text/javascript" src="../js/vue.js"></script>
</head>
<body>
<!--准备好一个容器-->
<div class="root">
    <h1>人员列表-遍历数组</h1>
    <input type="text" placeholder="请输入查询字符" v-model="keyword">
    <ul>
        <li v-for="(p) in persons" :key="p.id">
            {{p.name}}-{{p.age}}-{{p.sex}}
        </li>
    </ul>
    <hr/>

</div>


<script type="text/javascript">
    Vue.config.productionTip = false //阻止Vue在启动时生成生成提示

    new Vue({
        el: '.root',
        data:{
            keyword:'',
            persons:[
                {id:'001',name:'马冬梅',age:18,sex:'女'},
                {id:'002',name:'周冬雨',age:19,sex:'女'},
                {id:'003',name:'周杰伦',age:20,sex:'男'},
                {id:'003',name:'温兆伦',age:21,sex:'男'}
            ],

        }
    })
</script>
</body>
</html>